
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
markmap-lib
Advanced tools
Visualize your Markdown as mindmaps.
This project is heavily inspired by dundalek's markmap.
Node.js >= 10 is required.
$ yarn add markmap-lib
d3
is also required if you are using dist/view.js
with bundlers:
$ yarn add d3
See markmap-cli for command-line usage.
Transform Markdown to markmap data:
import { transform, getUsedAssets, getAssets } from 'markmap-lib/dist/transform';
// 1. transform markdown
const { root, features } = transform(markdown);
// 2. get assets
// either get assets required by used features
const { styles, scripts } = getUsedAssets(features);
// or get all possible assets that could be used later
const { styles, scripts } = getAssets();
Now we have the data for rendering.
Render a markmap from transformed data:
Create an SVG element with explicit width and height:
<script src="https://cdn.jsdelivr.net/npm/d3@5"></script>
<script src="https://cdn.jsdelivr.net/npm/markmap-lib/dist/browser/view.min.js"></script>
<svg id="markmap" style="width: 800px; height: 800px"></svg>
Render a markmap to the SVG element:
// We got { root } data from transforming, and possible extraneous assets { styles, scripts }.
const { Markmap, loadCSS, loadJS } = window.markmap;
// 1. load assets
if (styles) loadCSS(styles);
if (scripts) loadJS(scripts, { getMarkmap: () => window.markmap });
// 2. create markmap
Markmap.create('#markmap', null, root);
// or pass an SVG element directly
const svgEl = document.querySelector('#markmap');
Markmap.create(svgEl, null, data);
FAQs
Visualize your Markdown as mindmaps with Markmap
The npm package markmap-lib receives a total of 13,289 weekly downloads. As such, markmap-lib popularity was classified as popular.
We found that markmap-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.